Platform: Code4rena
Start Date: 14/06/2022
End Date: 19/06/2022
Period: 5 days
Status: Completed
Pot Size: $50,000 USDC
Participants: 99
Reporter: itsmetechjay
Judge: HardlyDifficult
Id: 136
League: ETH
PwnedNoMore | 1/99 | $7,659.98 | 6 | 4 | 1 | 1 | 1 | 0 | - | 0 |
unforgiven | 2/99 | $6,853.32 | 7 | 5 | 1 | 1 | 0 | - | 0 | 0 |
shenwilly | 3/99 | $5,213.95 | 5 | 1 | 1 | 3 | 0 | - | 0 | 0 |
kenzo | 4/99 | $2,839.95 | 4 | 3 | 0 | 1 | 0 | 0 | 0 | 0 |
0xDjango | 5/99 | $2,443.71 | 4 | 2 | 0 | 0 | 0 | - | - | 0 |
0xsanson | 6/99 | $2,342.09 | 6 | 3 | 0 | 3 | 0 | 0 | 0 | 0 |
WatchPug | 7/99 | $1,437.33 | 6 | 2 | 0 | 3 | 0 | - | 0 | 0 |
0xalpharush | 8/99 | $1,389.55 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 0 |
csanuragjain | 9/99 | $1,303.59 | 4 | 1 | 0 | 2 | 0 | - | 0 | 0 |
KIntern | 10/99 | $1,293.20 | 4 | 2 | 0 | 1 | 0 | - | 0 | 0 |
Auditor per page
These contracts will be used in production. They are gas optimized and a subset of our Certik audited v1 contracts. These are also reviewed by an independent auditor that helped us patch a few vulnerabilities and helped us optimize them for gas efficiency. We tested a version of these contracts with ERC721 and ERC20 transfer functions written in assembly for gas optimization. We've found that the gains are not significant (esp when compared to gas savings offered by batching orders) and decided to favor code readability over these optimizations. We hope to write them in Vyper with the help of Vyper community in the future. Contributions welcome.
Together with our off chain sniping engine, the contracts support a host of features:
Contracts are designed to be extensible. The main contract is InfinityExchange.sol
which is used for taking approvals for spending NFTs and transaction currencies like WETH
. It also has transfer functions that move assets between addresses. The contract is extensible via Complications
. Complications are used to extend the functionality of the main contract to support different order types. We currently have one complication - InfinityOrderBookComplication
that supports the order types above. More complications
are in the works.
This repo also includes our Staking and Token contracts.
Staking contract allows people to stake Infinity tokens to earn voting power. Votes are needed to curate collections on the Infinity marketplace. Curation helps surface upcoming/prominent collections. All exchange fees generated from the trading activity of curated collections go to curators in proportion to how many votes they used to curate a collection. As an example: if Doodles was curated with a total of 100 votes (for a given time period) and a curator used 10 of his votes to curate it, they will get 10% of the trading fee for that time period.
Token contract defines the Infinity ($NFT) token. It comes with a timelock config that allows gradual supply increase overtime. There is a max supply of 1B tokens. Initial supply will be 250M. There are 3 inflation epochs, each with a time gap of 6 months. Each inflation epoch adds 250M tokens to the supply. After 1B max supply is reached there won't be any more supply unless the max number of epochs is increased. Any change to timelock config requires a thawing period of 30 days so that the community has enough time to be updated on any changes.
Our contracts are the most efficient NFT exchange contracts in the world. Users save upto 60% gas compared to Opensea and Looksrare. We achieve these gas savings via contract supported batch execution.
Match orders gas table (auto sniped):
Take orders gas table (user initiated):
The contracts have been extensively tested. All tests can be found in the test
folder organized into different files. Tests can be run individually with npx hardhat test --grep <test name>
or all at once with ./runTests.sh
Coming soon.