Skip to content

Commit

Permalink
docs: add pre-optimize-gas-report, to compare with post-optimize-gas-…
Browse files Browse the repository at this point in the history
…report
  • Loading branch information
uri-99 committed Mar 6, 2024
1 parent e6c5a39 commit 0baf6a0
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ ethereum-build: ethereum-clean
@cd ./contracts/solidity/ && forge build

ethereum-test: ethereum-clean
@cd ./contracts/solidity/ && forge test
@cd ./contracts/solidity/ && forge test --gas-report

ethereum-deploy: ethereum-build
@. ./contracts/solidity/.env && . ./contracts/solidity/deploy.sh
Expand Down
50 changes: 50 additions & 0 deletions pre-optimize-gas-report
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Compiling 40 files with 0.8.24
Solc 0.8.24 finished in 1.17s
Compiler run successful!

Ran 4 tests for test/MM_ACL.sol:TransferTest
[PASS] test_getMMAddress() (gas: 14684)
[PASS] test_get_owner() (gas: 14834)
[PASS] test_set_MMAddress_not_owner() (gas: 38622)
[PASS] test_set_and_get_MMAddress_deployer() (gas: 47526)
Suite result: ok. 4 passed; 0 failed; 0 skipped; finished in 1.11ms (448.13µs CPU time)

Ran 8 tests for test/Transfer.sol:TransferTest
[PASS] testClaimPayment() (gas: 200512)
[PASS] testClaimPaymentLow() (gas: 200438)
[PASS] testClaimPaymentOver() (gas: 200703)
[PASS] testClaimPayment_fail_noOrderId() (gas: 51442)
[PASS] testClaimPayment_fail_notOwnerOrMM() (gas: 48567)
[PASS] testClaimPayment_mm() (gas: 213850)
[PASS] testTransfer_fail_notOwnerOrMM() (gas: 48492)
[PASS] testTransfer_mm() (gas: 153048)
Suite result: ok. 8 passed; 0 failed; 0 skipped; finished in 1.12ms (861.12µs CPU time)
| lib/openzeppelin-contracts-upgradeable/lib/openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol:ERC1967Proxy contract | | | | | |
|----------------------------------------------------------------------------------------------------------------------------------|-----------------|--------|--------|--------|---------|
| Deployment Cost | Deployment Size | | | | |
| 130457 | 1130 | | | | |
| Function Name | min | avg | median | max | # calls |
| claimPayment | 31211 | 42598 | 45931 | 52631 | 6 |
| getMMAddress | 765 | 4015 | 4015 | 7265 | 2 |
| initialize | 144784 | 144784 | 144784 | 144784 | 12 |
| owner | 7325 | 7325 | 7325 | 7325 | 1 |
| setMMAddress | 28990 | 31490 | 31490 | 33991 | 2 |
| transfer | 31168 | 118292 | 135643 | 136015 | 6 |


| src/PaymentRegistry.sol:PaymentRegistry contract | | | | | |
|--------------------------------------------------|-----------------|--------|--------|--------|---------|
| Deployment Cost | Deployment Size | | | | |
| 1155326 | 5236 | | | | |
| Function Name | min | avg | median | max | # calls |
| claimPayment | 4809 | 16147 | 19548 | 26248 | 6 |
| getMMAddress | 375 | 1375 | 1375 | 2375 | 2 |
| initialize | 117439 | 117439 | 117439 | 117439 | 12 |
| owner | 2435 | 2435 | 2435 | 2435 | 1 |
| setMMAddress | 2661 | 5165 | 5165 | 7669 | 2 |
| transfer | 4766 | 91844 | 109260 | 109260 | 6 |




Ran 2 test suites in 6.83ms (2.22ms CPU time): 12 tests passed, 0 failed, 0 skipped (12 total tests)

0 comments on commit 0baf6a0

Please sign in to comment.