Putty contest - codetilda's results

An order-book based american options market for NFTs and ERC20s.

General Information

Platform: Code4rena

Start Date: 29/06/2022

Pot Size: $50,000 USDC

Total HM: 20

Participants: 133

Period: 5 days

Judge: hickuphh3

Total Solo HM: 1

Id: 142

League: ETH

Putty

Findings Distribution

Researcher Performance

Rank: 128/133

Findings: 1

Award: $21.17

🌟 Selected for report: 0

🚀 Solo Findings: 0

Computed constants in the contract PuttyV2.sol

Source repo: https://github.com/code-423n4/2022-06-putty/blob/main/contracts/src/PuttyV2.sol

Instead of

/* ~~~ STATE VARIABLES ~~~ */ /** @dev ERC721Asset type hash used for EIP-712 encoding. */ bytes32 public constant ERC721ASSET_TYPE_HASH = keccak256(abi.encodePacked("ERC721Asset(address token,uint256 tokenId)")); /** @dev ERC20Asset type hash used for EIP-712 encoding. */ bytes32 public constant ERC20ASSET_TYPE_HASH = keccak256(abi.encodePacked("ERC20Asset(address token,uint256 tokenAmount)")); /** @dev ERC721Asset type hash used for EIP-712 encoding. */ bytes32 public constant ORDER_TYPE_HASH = keccak256( abi.encodePacked( "Order(", "address maker,", "bool isCall,", "bool isLong,", "address baseAsset,", "uint256 strike,", "uint256 premium,", "uint256 duration,", "uint256 expiration,", "uint256 nonce,", "address[] whitelist,", "address[] floorTokens,", "ERC20Asset[] erc20Assets,", "ERC721Asset[] erc721Assets", ")", "ERC20Asset(address token,uint256 tokenAmount)", "ERC721Asset(address token,uint256 tokenId)" ) );

we can write directly this values:

/* ~~~ STATE VARIABLES ~~~ */ /** @dev ERC721Asset type hash used for EIP-712 encoding. */ bytes32 public constant ERC721ASSET_TYPE_HASH = 0x768c1d2c3157c9ca752098be2da2da3e1ddae5a69ca4394b1f83e1179407e8f0; /** @dev ERC20Asset type hash used for EIP-712 encoding. */ bytes32 public constant ERC20ASSET_TYPE_HASH = 0xa55d25ac87b1c0e125b844871149c64ce5636cae2bb0ed2f2eb4990df479cd91; /** @dev ERC721Asset type hash used for EIP-712 encoding. */ bytes32 public constant ORDER_TYPE_HASH = 0x331cf33dce9314036c50f72ada91444e078be32f06bf1d891362de01ac1a8d66;
AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter