Closed 0xjona closed 2 years ago
For which release do we expect to close the issue? @turinglabsorg
As soon as possible
This is the result of the first foundry tests, we have added a folder called foundry_tests
so anyone can reproduce those results.
Comments on the results:
createDealProposa
l is the function consuming more gas, and it is because it writes on chain the deal parameters
deals[index].timestamp_request = block.timestamp;
deals[index].owner = msg.sender;
deals[index].deal_uri = _deal_uri;
deals[index].duration = duration;
deals[index].collateral = collateral;
deals[index].value = msg.value;
We think this in okay, nothing we can change if we want to have on chain deals;
OPENSEA SWAP https://etherscan.io/tx/0x7ff09e55f6160dc08bb779a96981233a2a7e7f7b094b6ec7d35d1f9cfe918ef9 GAS USED: 190,938
UNISWAP EXCHANGE V3 https://etherscan.io/tx/0xbadd1e9e0903f0a85fa7c657524cdd6da156b9411da772ff4e0f3528580c7333 GAS USED: 131,567
UNISWAP EXCHANGE V2 https://etherscan.io/tx/0x78ed2311129666e9a05411a6e739d30a8e3309fdbca21330fc8e0187fb948ff8 GAS USED: 101,665
UNISWAP POSITION NFT https://etherscan.io/tx/0x0fd95f53be1f0c5e0af4192be0c294c8e203f3f8c18f9610bc72195344670048 GAS USED: 297,866
REGISTER ENS https://etherscan.io/tx/0x9d7ee5c2bdd4c8ef5a5932db143b7bf4691f70c0c1d8bce617c50554c7164a65 GAS USED: 256,871
@irenegia can we close this issue?
I think so
We decided to use foundry and run some test to understand the gas cost details of our smart contract (ie, the gas cost of each functions used in the contract).