Skip to content

Commit

Permalink
Small _initCode reformatting
Browse files Browse the repository at this point in the history
  • Loading branch information
telome committed Dec 20, 2023
1 parent b91b869 commit b1d0ab9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/LockstakeEngine.sol
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ contract LockstakeEngine is Multicall {

// See the reference implementation in https://eips.ethereum.org/EIPS/eip-1167
function _initCode() internal view returns (bytes memory code) {
code = new bytes(55);
code = new bytes(0x37);
bytes20 impl = bytes20(urnImplementation);
assembly {
mstore(add(code, 0x20), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(code, 0x20), 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
mstore(add(code, add(0x20, 0x14)), impl)
mstore(add(code, add(0x20, 0x28)), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
}
Expand Down Expand Up @@ -231,7 +231,7 @@ contract LockstakeEngine is Multicall {
uint256 salt = uint256(keccak256(abi.encode(msg.sender, index)));
bytes memory initCode = _initCode();
assembly {
urn := create2(0, add(initCode, 0x20), mload(initCode), salt)
urn := create2(0, add(initCode, 0x20), 0x37, salt)
if iszero(extcodesize(urn)) { revert(0, 0) }
}
LockstakeUrn(urn).init();
Expand Down

0 comments on commit b1d0ab9

Please sign in to comment.