Skip to content

Commit

Permalink
deployed cleaned singlesig with token callbacks to 0x000000dE1E80ea5a…
Browse files Browse the repository at this point in the history
…234FB5488fee2584251BC7e8
  • Loading branch information
0xfoobar committed Sep 19, 2023
1 parent b20bb86 commit 233bdea
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/DelegateRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/singlesig/Singlesig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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)"));
}

Expand Down
2 changes: 1 addition & 1 deletion test/DelegateRegistry.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions test/InitCodeHash.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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));
}
Expand Down

0 comments on commit 233bdea

Please sign in to comment.