From 233bdeac5f25703063ce0b03f6207fbf80f38cdd Mon Sep 17 00:00:00 2001 From: 0xfoobar <0xfoobar1@gmail.com> Date: Tue, 19 Sep 2023 10:33:38 -0400 Subject: [PATCH] deployed cleaned singlesig with token callbacks to 0x000000dE1E80ea5a234FB5488fee2584251BC7e8 --- script/Deploy.s.sol | 2 +- src/DelegateRegistry.sol | 2 +- src/singlesig/Singlesig.sol | 4 ++-- test/DelegateRegistry.t.sol | 2 +- test/InitCodeHash.t.sol | 2 ++ 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/script/Deploy.s.sol b/script/Deploy.s.sol index 9ebee64..8cfe8d8 100644 --- a/script/Deploy.s.sol +++ b/script/Deploy.s.sol @@ -18,7 +18,7 @@ contract Deploy is Script { // bytes32 salt = 0x00000000000000000000000000000000000000008b99e5a778edb02572010000; bytes initCode = abi.encodePacked(type(Singlesig).creationCode, abi.encode(address(0x6Ed7D526b020780f694f3c10Dfb25E1b134D3215))); - bytes32 salt = 0x0000000000000000000000000000000000000000eab62839b3422a092c19bdab; + bytes32 salt = 0x000000000000000000000000000000000000000016c7768a8c7a2824b846321d; function run() external { vm.startBroadcast(); diff --git a/src/DelegateRegistry.sol b/src/DelegateRegistry.sol index d9a3366..8cf0a00 100644 --- a/src/DelegateRegistry.sol +++ b/src/DelegateRegistry.sol @@ -151,7 +151,7 @@ contract DelegateRegistry is IDelegateRegistry { function sweep() external { assembly ("memory-safe") { // This hardcoded address is a CREATE2 factory counterfactual smart contract wallet that will always accept native token transfers - let result := call(gas(), 0x000000de1E803040Fba6B848D410a55FaB8B3256, selfbalance(), 0, 0, 0, 0) + let result := call(gas(), 0x000000dE1E80ea5a234FB5488fee2584251BC7e8, selfbalance(), 0, 0, 0, 0) } } diff --git a/src/singlesig/Singlesig.sol b/src/singlesig/Singlesig.sol index 6bb49ab..3de1896 100644 --- a/src/singlesig/Singlesig.sol +++ b/src/singlesig/Singlesig.sol @@ -57,11 +57,11 @@ contract Singlesig { || interfaceId == 0x4e2312e0; // ERC165 Interface ID for ERC1155TokenReceiver } - function onERC721Received(address, address, uint256, bytes calldata) external view returns (bytes4) { + function onERC721Received(address, address, uint256, bytes calldata) external pure returns (bytes4) { return 0x150b7a02; //bytes4(keccak256("onERC721Received(address,uint256,bytes)")); } - function onERC1155Received(address, address, uint256, uint256, bytes calldata) external returns (bytes4) { + function onERC1155Received(address, address, uint256, uint256, bytes calldata) external pure returns (bytes4) { return 0xf23a6e61; // bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)")); } diff --git a/test/DelegateRegistry.t.sol b/test/DelegateRegistry.t.sol index a21d07e..4631fc0 100644 --- a/test/DelegateRegistry.t.sol +++ b/test/DelegateRegistry.t.sol @@ -255,7 +255,7 @@ contract DelegateRegistryTest is Test { } function testSweep(address to, address contract_, uint256 tokenId, uint256 amount, bytes32 rights_, bool enable) public { - address sc = address(0x000000de1E803040Fba6B848D410a55FaB8B3256); + address sc = address(0x000000dE1E80ea5a234FB5488fee2584251BC7e8); uint256 regBalanceBefore = address(reg).balance; uint256 scBalanceBefore = address(sc).balance; bytes[] memory data = new bytes[](1); diff --git a/test/InitCodeHash.t.sol b/test/InitCodeHash.t.sol index 356092c..36fc452 100644 --- a/test/InitCodeHash.t.sol +++ b/test/InitCodeHash.t.sol @@ -20,6 +20,7 @@ import {Singlesig} from "src/singlesig/Singlesig.sol"; // Seed 0x0000000000000000000000000000000000000000eab62839b3422a092c19bdab => 0x000000de1E803040Fba6B848D410a55FaB8B3256 // new inithash: 0xf911e320d18e7274491e7ab207bfff830e2926248f86c6a987668e8e72e1ed77 +// salt 0x000000000000000000000000000000000000000016c7768a8c7a2824b846321d => 0x000000dE1E80ea5a234FB5488fee2584251BC7e8 contract InitCodeHashTest is Test { DelegateRegistry reg; @@ -33,6 +34,7 @@ contract InitCodeHashTest is Test { function getInitHash() public pure returns (bytes32) { // bytes memory bytecode = type(DelegateRegistry).creationCode; bytes memory initCode = abi.encodePacked(type(Singlesig).creationCode, abi.encode(address(0x6Ed7D526b020780f694f3c10Dfb25E1b134D3215))); + // console2.logBytes(initCode); return keccak256(abi.encodePacked(initCode)); }