Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

Reduce Deploy Cost of All Contracts #167

Merged
merged 11 commits into from
Jun 26, 2020
Merged

Conversation

steviezhang
Copy link
Contributor

@steviezhang steviezhang commented Jun 4, 2020

Changes

  • stripped down contracts and created own utils out of openzeppelin utils if it reduced gas cost.
  • Removed Ownable from bridge, as we never used the functionality
  • Note that the constructor for the bridge costs us 100000 gas
  • Updated tests.
  • Note that Generic Handler using Handler Helpers resulted in increased gas cost, so it was removed.
  • Reduce reason strings

deploy costs changes on this branch

┌─────────┬───────────────────┬─────────┐
│ (index) │       type        │ gasUsed │
├─────────┼───────────────────┼─────────┤
│    0    │     'Bridge'      │ 4081769 │
│    1    │  'ERC20Handler'   │ 1680230 │
│    2    │  'ERC721Handler'  │ 1915811 │
│    3    │ 'GenericHandler'  │ 1411471 │
│    4    │ 'CentrifugeAsset' │ 197353  │
│    5    │ 'HandlerHelpers'  │ 453535  │
│    6    │    'ERC20Safe'    │ 256244  │
│    7    │   'ERC721Safe'    │ 147103  │
└─────────┴───────────────────┴─────────┘

Master

┌─────────┬───────────────────┬─────────┐
│ (index) │       type        │ gasUsed │
├─────────┼───────────────────┼─────────┤
│    0    │     'Bridge'      │ 4164739 │
│    1    │  'ERC20Handler'   │ 1680586 │
│    2    │  'ERC721Handler'  │ 1916167 │
│    3    │ 'GenericHandler'  │ 1467997 │
│    4    │ 'CentrifugeAsset' │ 197353  │
│    5    │ 'HandlerHelpers'  │ 453535  │
│    6    │    'ERC20Safe'    │ 256244  │
│    7    │   'ERC721Safe'    │ 147103  │
└─────────┴───────────────────┴─────────┘

Closes: #162 Closes: #116 Closes: #165

@steviezhang steviezhang marked this pull request as ready for review June 26, 2020 19:32
@steviezhang steviezhang merged commit 53d4355 into master Jun 26, 2020
@steviezhang steviezhang deleted the steph/importReduction branch June 26, 2020 20:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants