Skip to content

Commit

Permalink
Fix incorrect owner due to using deployment proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
matejos committed Nov 10, 2023
1 parent 54b0a9b commit 8b0d036
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions evm/script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ contract Deploy is Script {
vm.startBroadcast();

uint256 lockTime = 1 minutes;
bytes32 dummySalt = bytes32(uint256(123));
Hololocker hololocker = new Hololocker{salt: dummySalt}(lockTime);
bytes32 dummySalt = bytes32(uint256(1));
Hololocker hololocker = new Hololocker{salt: dummySalt}(lockTime, msg.sender);
console2.log("Hololocker implementation:", address(hololocker));

vm.stopBroadcast();
Expand Down
3 changes: 2 additions & 1 deletion evm/src/Hololocker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,9 @@ contract Hololocker is HololockerInterface, Ownable {
error UnlockAlreadyRequested();
error InvalidInputArity();

constructor(uint256 lockTime_) {
constructor(uint256 lockTime_, address owner_) {
lockTime = lockTime_;
_transferOwnership(owner_);
}

/// @notice Returns `LockInfo` for specified `token => tokenId`
Expand Down
2 changes: 1 addition & 1 deletion evm/test/Hololocker.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ contract HololockerTest is Test {
uint256 maxLockTime;

function setUp() public {
hololocker = new Hololocker(1 minutes);
hololocker = new Hololocker(1 minutes, address(this));
mockNFT = new MockNFT("X", "Y");
tokenIds.push(0);
tokens.push(address(mockNFT));
Expand Down

0 comments on commit 8b0d036

Please sign in to comment.