Skip to content

Commit

Permalink
fix deployer.sol lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
0x3bfc committed May 7, 2020
1 parent 3c94e12 commit b572d6a
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions contracts/utils/Deployer.sol
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
pragma solidity ^0.5.7;

contract Deployer {
event InstanceDeployed(address instance);

event InstanceDeployed(address instance);

function deploy(address _logic) internal returns (address instance) {
bytes20 targetBytes = bytes20(_logic);
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clone, 0x14), targetBytes)
mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
instance := create(0, clone, 0x37)
function deploy(
address _logic
)
internal
returns (address instance)
{
bytes20 targetBytes = bytes20(_logic);
/* solium-disable-next-line security/no-inline-assembly */
assembly {
let clone := mload(0x40)
mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(clone, 0x14), targetBytes)
mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
instance := create(0, clone, 0x37)
}
emit InstanceDeployed(address(instance));
}
emit InstanceDeployed(address(instance));
}
}

0 comments on commit b572d6a

Please sign in to comment.