Skip to content

Commit

Permalink
Add new cost figures.
Browse files Browse the repository at this point in the history
  • Loading branch information
surangap committed Jun 30, 2024
1 parent 2f52483 commit ee3d7bb
Show file tree
Hide file tree
Showing 7 changed files with 113 additions and 107 deletions.
2 changes: 1 addition & 1 deletion e2e/test/Dex/Dex.TxCosts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ describe("Dex Gas Estimation", function () {

after(async () => {
saveTxGas(allCosts, "Dex/TxCosts.md", "Dex Precompiles");
saveTxFees(allTxFeeCosts, "Dex/TxCosts.md", "ERC20 Precompiles");
saveTxFees(allTxFeeCosts, "Dex/TxCosts.md", "Dex Precompiles");
await node.stop();
});

Expand Down
31 changes: 16 additions & 15 deletions e2e/test/Dex/TxCosts.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
## Generated tx costs(Gas) for Dex Precompiles

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
| :----------------------- | :----------: | :------------: | :-----------------------: |
| addLiquidity | 217853 | 122103 | 28027 |
| removeLiquidity | 183441 | 86009 | 23350 |
| swapExactTokensForTokens | 150598 | 70507 | 23345 |
| swapTokensForExactTokens | 150743 | 71568 | 25012 |
| quote | 23716 | 22377 | 0 |
| getAmountOut | 26047 | 22447 | 0 |
| getAmountsOut | 43843 | 42619 | 0 |
| getAmountsIn | 44058 | 42611 | 0 |
|:-------------------------|:------------:|:--------------:|:-------------------------:|
| addLiquidity | 197723 | 89078 | 52145 |
| removeLiquidity | 170713 | 68838 | 34641 |
| swapExactTokensForTokens | 133986 | 52401 | 26421 |
| swapTokensForExactTokens | 134130 | 53006 | 27404 |
| quote | 44688 | 22377 | 0 |
| getAmountOut | 44688 | 22423 | 0 |
| getAmountsOut | 120661 | 34806 | 0 |
| getAmountsIn | 120661 | 34799 | 0 |

## Generated tx costs(fees) for ERC20 Precompiles

## Generated tx costs(fees) for Dex Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
| :----------------------- | :-------------------: | :---------------------: | :--------------------: |
| addLiquidity | 2968616 | 1807995 | 420415 |
| removeLiquidity | 2365301 | 1260861 | 350263 |
| swapExactTokensForTokens | 2185298 | 985238 | 350186 |
| swapTokensForExactTokens | 2187623 | 1004110 | 375190 |
|:-------------------------|:---------------------:|:-----------------------:|:----------------------:|
| addLiquidity | 1338027 | 657776 | 391089 |
| removeLiquidity | 1072046 | 477830 | 259813 |
| swapExactTokensForTokens | 968038 | 387534 | 198163 |
| swapTokensForExactTokens | 969201 | 393986 | 205532 |
39 changes: 20 additions & 19 deletions e2e/test/ERC1155/TxCosts.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
## Generated tx costs(Gas) for ERC1155 Precompiles

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
| :-------------------- | :----------: | :------------: | :-----------------------: |
| uri | 27560 | 22400 | 0 |
| balanceOf | 25957 | 22433 | 0 |
| balanceOfBatch | 32585 | 24106 | 0 |
| setApprovalForAll | 47025 | 27501 | 0 |
| isApprovedForAll | 26076 | 23184 | 0 |
| safeTransferFrom | 59163 | 32160 | 23335 |
| safeBatchTransferFrom | 50205 | 35812 | 26670 |
| mint | 33152 | 32245 | 23503 |
| mintBatch | 42210 | 32633 | 26836 |
| burn | 32581 | 27608 | 20002 |
| burnBatch | 38043 | 31828 | 23335 |
|:----------------------|:------------:|:--------------:|:-------------------------:|
| uri | 27560 | 22376 | 0 |
| balanceOf | 25957 | 22408 | 0 |
| balanceOfBatch | 32585 | 23721 | 0 |
| setApprovalForAll | 47025 | 26235 | 0 |
| isApprovedForAll | 26076 | 22432 | 0 |
| safeTransferFrom | 74307 | 28882 | 10552 |
| safeBatchTransferFrom | 75516 | 32822 | 13297 |
| mint | 74473 | 28572 | 11373 |
| mintBatch | 75540 | 29371 | 12306 |
| burn | 32581 | 26141 | 9630 |
| burnBatch | 38043 | 28466 | 10563 |


## Generated tx costs(fees) for ERC1155 Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
| :-------------------- | :-------------------: | :---------------------: | :--------------------: |
| safeTransferFrom | 880468 | 462181 | 350038 |
| safeBatchTransferFrom | 728112 | 535973 | 400055 |
| mint | 493954 | 464911 | 352545 |
| mintBatch | 589858 | 477332 | 402545 |
| burn | 475652 | 407185 | 300038 |
| burnBatch | 569231 | 451575 | 350038 |
|:----------------------|:---------------------:|:-----------------------:|:----------------------:|
| safeTransferFrom | 440278 | 215285 | 79140 |
| safeBatchTransferFrom | 364092 | 241713 | 99732 |
| mint | 247001 | 214100 | 85301 |
| mintBatch | 294958 | 220311 | 92301 |
| burn | 237850 | 189637 | 72228 |
| burnBatch | 284644 | 211834 | 79228 |
27 changes: 14 additions & 13 deletions e2e/test/ERC20/TxCosts.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
## Generated tx costs(Gas) for ERC20 Precompiles

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
| :------------ | :----------: | :------------: | :-----------------------: |
| totalSupply | 23717 | 22388 | 0 |
| balanceOf | 25860 | 23974 | 0 |
|:--------------|:------------:|:--------------:|:-------------------------:|
| totalSupply | 23717 | 22364 | 0 |
| balanceOf | 25860 | 23692 | 0 |
| allowance | 26064 | 23273 | 0 |
| approval | 47152 | 26470 | 20170 |
| transfer | 52698 | 43641 | 20172 |
| transferFrom | 44716 | 51726 | 23340 |
| name | 25926 | 22388 | 0 |
| decimals | 22354 | 22388 | 0 |
| symbol | 25945 | 22388 | 0 |
| approval | 47152 | 26133 | 11781 |
| transfer | 52698 | 35514 | 15505 |
| transferFrom | 44716 | 43610 | 18728 |
| name | 25926 | 22364 | 0 |
| decimals | 22354 | 22364 | 0 |
| symbol | 25945 | 22364 | 0 |


## Generated tx costs(fees) for ERC20 Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
| :------------ | :-------------------: | :---------------------: | :--------------------: |
| approval | 702835 | 396804 | 302557 |
| transfer | 781323 | 622692 | 302592 |
| transferFrom | 647164 | 760526 | 350114 |
|:--------------|:---------------------:|:-----------------------:|:----------------------:|
| approval | 351452 | 189442 | 88360 |
| transfer | 390700 | 263777 | 116288 |
| transferFrom | 323614 | 310917 | 140466 |
51 changes: 26 additions & 25 deletions e2e/test/ERC721/TxCosts.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
## Generated tx costs(Gas) for ERC721 Precompiles

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
| :---------------- | :----------: | :------------: | :-----------------------: |
| balanceOf | 25895 | 23274 | 0 |
| ownerOf | 25847 | 23242 | 0 |
| getApproved | 27395 | 23242 | 0 |
| isApprovedForAll | 26082 | 23973 | 0 |
| mint | 53193 | 31731 | 17336 |
| burn | 37870 | 35731 | 17170 |
| approve | 50740 | 28884 | 23835 |
| setApprovalForAll | 47011 | 26467 | 23335 |
| safetransferFrom | 67181 | 36625 | 0 |
| transferFrom | 66839 | 35560 | 20670 |
| name | 25932 | 22388 | 0 |
| symbol | 25938 | 22388 | 0 |
| tokenURI | 25964 | 23242 | 0 |
| owner | 23728 | 22388 | 0 |
| transferOwnership | 29147 | 28498 | 19835 |
| renounceOwnership | 30272 | 28372 | 19835 |
|:------------------|:------------:|:--------------:|:-------------------------:|
| balanceOf | 25895 | 23238 | 0 |
| ownerOf | 25847 | 23206 | 0 |
| getApproved | 27395 | 23206 | 0 |
| isApprovedForAll | 26082 | 23733 | 0 |
| mint | 81095 | 27732 | 9216 |
| burn | 37870 | 32429 | 10522 |
| approve | 50740 | 27473 | 10851 |
| setApprovalForAll | 47011 | 26130 | 9700 |
| safetransferFrom | 77443 | 32611 | 0 |
| transferFrom | 66839 | 32381 | 11584 |
| name | 25932 | 22364 | 0 |
| symbol | 25938 | 22364 | 0 |
| tokenURI | 25964 | 23206 | 0 |
| owner | 23728 | 22364 | 0 |
| transferOwnership | 29147 | 27419 | 9501 |
| renounceOwnership | 30272 | 26402 | 9454 |


## Generated tx costs(fees) for ERC721 Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
| :---------------- | :-------------------: | :---------------------: | :--------------------: |
| mint | 791884 | 448454 | 260041 |
| burn | 490684 | 533648 | 257553 |
| approve | 739543 | 430633 | 357539 |
| setApprovalForAll | 699609 | 396639 | 350030 |
| transferFrom | 884488 | 528637 | 310054 |
| transferOwnership | 436153 | 424962 | 297536 |
| renounceOwnership | 352310 | 419621 | 297536 |
|:------------------|:---------------------:|:-----------------------:|:----------------------:|
| mint | 395981 | 206426 | 69121 |
| burn | 245366 | 235419 | 78921 |
| approve | 369808 | 200507 | 81389 |
| setApprovalForAll | 349839 | 189360 | 72751 |
| transferFrom | 442288 | 234646 | 86885 |
| transferOwnership | 218098 | 199277 | 71258 |
| renounceOwnership | 176172 | 196606 | 70908 |
25 changes: 13 additions & 12 deletions e2e/test/Futurepass/TxCosts.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
## Generated tx costs(Gas) for Futurepass Precompiles

| Function Call | Contract gas | Precompile gas | (Extrinsic fee/Gas price) |
| :---------------------------- | :----------: | :------------: | :-----------------------: |
| create | 0 | 45155 | 19173 |
| registerDelegateWithSignature | 0 | 46072 | 34006 |
| unregisterDelegate | 0 | 43622 | 22339 |
| transferOwnership | 0 | 52086 | 22508 |
| proxyCall | 0 | 65694 | 24009 |
|:------------------------------|:------------:|:--------------:|:-------------------------:|
| create | 0 | 36968 | 16352 |
| registerDelegateWithSignature | 0 | 38388 | 20188 |
| unregisterDelegate | 0 | 35481 | 16200 |
| transferOwnership | 0 | 43720 | 20407 |
| proxyCall | 0 | 65259 | 21152 |


## Generated tx costs(fees) for Futurepass Precompiles

| Function Call | Contract cost (Drops) | Precompile cost (Drops) | Extrinsic cost (Drops) |
| :---------------------------- | :-------------------: | :---------------------: | :--------------------: |
| create | 0 | 657200 | 287602 |
| registerDelegateWithSignature | 0 | 678157 | 510100 |
| unregisterDelegate | 0 | 622142 | 335093 |
| transferOwnership | 0 | 768256 | 337632 |
| proxyCall | 0 | 899654 | 360135 |
|:------------------------------|:---------------------:|:-----------------------:|:----------------------:|
| create | 0 | 274734 | 122645 |
| registerDelegateWithSignature | 0 | 286864 | 151414 |
| unregisterDelegate | 0 | 263205 | 121506 |
| transferOwnership | 0 | 312227 | 153054 |
| proxyCall | 0 | 446016 | 158642 |
Loading

0 comments on commit ee3d7bb

Please sign in to comment.