-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solmate Token Tests (ERC20.sol, WETH.sol, ERC721.sol, ERC1155.sol) #2
base: main
Are you sure you want to change the base?
Conversation
Instead of using this to check if an address is a wallet for ERC-721 and ERC-1155: function isWallet(address account) public view returns (bool) {
uint size;
assembly {
size := extcodesize(account)
}
return size == 0;
} we could try to see if this works instead: function isWallet(address account) internal view returns (bool) {
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
bytes32 codeHash;
assembly {
codeHash := extcodehash(account)
}
return (codeHash != accountHash && codeHash != 0x0) == false;
} |
Warp does not appear to support opcode extcodehash with the test above here: assembly {
codeHash := extcodehash(account)
} I tried to work around this by getting the bytecode and then trying to hash it manually as specified in EIP-1052: https://eips.ethereum.org/EIPS/eip-1052 function isWallet(address account) public view returns (bool) {
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
bytes32 codeHash = keccak256(abi.encodePacked(account.code));
return (codeHash != accountHash && codeHash != 0x0) == false;
} However, account.code seems to fail as well since it depends on opcode EXTCODESIZE. Are there other ways to check if an address is a wallet? If not, maybe we ignore the wallet address checks for ERC-721 and ERC-1155 for now. |
901dc4c
to
bd584e4
Compare
…r isWallet method
Starknet implements Account Abstraction, so you cannot differentiate an "externally" owned account from a contract |
Should we remove all wallet address checks for ERC-721 and ERC-1155 https://eips.ethereum.org/EIPS/eip-2938 ? |
🟢 Contracts are set to Solidity 0.8.14 for Warp compatibility.
🔴 Contracts have been slightly modified with some features removed to transpile in Warp.
Features not supported yet have been removed and mentioned in the branch README:
https://github.com/NethermindEth/warping-contracts/tree/solmate#solmate
Running shell command:
Returns: