Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CI] Test for reduce-contract-size branch #244

Merged
merged 1 commit into from
Jun 6, 2023

Conversation

nxqbao
Copy link
Contributor

@nxqbao nxqbao commented Jun 6, 2023

No description provided.

@nxqbao nxqbao merged commit 1c1cac3 into dev Jun 6, 2023
nxqbao added a commit that referenced this pull request Jun 6, 2023
add ci for reduce-contract-size
TuDo1403 added a commit that referenced this pull request Jun 8, 2023
* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* feat: efficient hashing

* [CI] Test for `reduce-contract-size` branch (#244)

add ci for reduce-contract-size

* feat: add contract size log

* feat: update contract size log

* format: rename parameter for new code convention

* format: format code

* fix: remove storage layout log

* fix: delete storage layout

* fix: delete yarn lock

* feat: remove changes in yarn.lock

* revert change in package.json & yarn.lock

---------

Co-authored-by: Bao <[email protected]>
Co-authored-by: Duc Tho Tran <[email protected]>
TuDo1403 added a commit that referenced this pull request Jun 8, 2023
…ttter logics utilizing only 1 abstract class (#242)

* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* feat: merge collections contract to one contract

* feat: apply HasContract to other contracts

* chore: remove unused contracts

* [CI] Test for `reduce-contract-size` branch (#244)

add ci for reduce-contract-size

* feat: add contract size log

* chore: rename deprecated values

* chore: rename custom slot

* feat: change ErrZeroCodeContract parameter

* feat: update contract size log

* Update contracts/ronin/validator/CoinbaseExecution.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/interfaces/collections/IHasContract.sol

Co-authored-by: Bao <[email protected]>

* feat: reserve 0 index for enum Roles

* chore: rename EMERGENCY_PAUSER -> PAUSE_ENFORCER_CONTRACT

* feat: arrange role contract or eoa by parity order

* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* format: rename internal fn

* feat: update contract code sizes log

* feat: update contract size log

* format: format code

* feat: rename HasContract -> HasContracts

---------

Co-authored-by: Bao <[email protected]>
TuDo1403 added a commit that referenced this pull request Jun 15, 2023
* [*] Reduce code size: uncheck for loop iterations (#229)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

---------

Co-authored-by: Bao <[email protected]>

* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* chore: gitignore for yarn berry

* feat: bump [email protected]

* fix rebase issue

* Fix package issue. Upgrade node version for CI.

* add contract size log

* format: rename internal fn

* format: rename internal fn

* format: remove duplicated import

* format: reorder import

* chore: reduce unused log file

* format: rename internal fn

* Update contracts/extensions/GovernanceAdmin.sol

Co-authored-by: Duc Tho Tran <[email protected]>

* format: fix weird grouping

* fix: fix bug not return whole tx if using internal fn

* format: rename internal fn

* Update contracts/extensions/bridge-operator-governance/BOsGovernanceRelay.sol

Co-authored-by: Duc Tho Tran <[email protected]>

* format: rename internal fn

* format: fix weird grouping

* format: fix weird grouping

* Update contracts/extensions/forwarder/Forwarder.sol

Co-authored-by: Duc Tho Tran <[email protected]>

* feat: rename Errors.sol -> CommonErrors.sol

* format: import only used error from lib

* format: rename enum Roles -> Role

* fix: fix error rename

* format: fix weird import grouping

* fix: remove duplicated for loop increment

* feat: uncheck while loop iteration

* feat: update contract size log

* [*] Reduce code size: remove bytecodehash (#245)

* feat: set bytecodehash to none to avoid nondeterministic bytecode and reduce overall code size by 0.04kb

* Update hardhat.config.ts

Co-authored-by: Duc Tho Tran <[email protected]>

---------

Co-authored-by: Duc Tho Tran <[email protected]>

* format: format code

* [*] Reduce Contract Size: uncheck all incrementation (#246)

feat: uncheck increment

* [*] Reduce code size: efficient hashing to avoid memory expansion (#241)

* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* feat: efficient hashing

* [CI] Test for `reduce-contract-size` branch (#244)

add ci for reduce-contract-size

* feat: add contract size log

* feat: update contract size log

* format: rename parameter for new code convention

* format: format code

* fix: remove storage layout log

* fix: delete storage layout

* fix: delete yarn lock

* feat: remove changes in yarn.lock

* revert change in package.json & yarn.lock

---------

Co-authored-by: Bao <[email protected]>
Co-authored-by: Duc Tho Tran <[email protected]>

* [*] Reduce code size: Remove duplicated authorized contract getter/settter logics utilizing only 1 abstract class (#242)

* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* feat: merge collections contract to one contract

* feat: apply HasContract to other contracts

* chore: remove unused contracts

* [CI] Test for `reduce-contract-size` branch (#244)

add ci for reduce-contract-size

* feat: add contract size log

* chore: rename deprecated values

* chore: rename custom slot

* feat: change ErrZeroCodeContract parameter

* feat: update contract size log

* Update contracts/ronin/validator/CoinbaseExecution.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/interfaces/collections/IHasContract.sol

Co-authored-by: Bao <[email protected]>

* feat: reserve 0 index for enum Roles

* chore: rename EMERGENCY_PAUSER -> PAUSE_ENFORCER_CONTRACT

* feat: arrange role contract or eoa by parity order

* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* format: rename internal fn

* feat: update contract code sizes log

* feat: update contract size log

* format: format code

* feat: rename HasContract -> HasContracts

---------

Co-authored-by: Bao <[email protected]>

* feat: preserve storage slot layouts

* feat: update contract size log

* format: update comment

* format: rename deprecated variable

* add comment of original code for asm

* Update contracts/libraries/DeprecatedSlots.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/libraries/Role.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/libraries/Role.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/libraries/Token.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/ronin/gateway/RoninGatewayV2.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/ronin/gateway/RoninGatewayV2.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/ronin/slash-indicator/CreditScore.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/ronin/staking/CandidateStaking.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/ronin/Maintenance.sol

Co-authored-by: Bao <[email protected]>

* refactor: add cmt, rename var, update asm

* fix rebase issues

* remove dev tag

* add storage layout

* fix comment

* format: move Role, DeprecatedSlots, CommonErrors to utils

* feat: change error ErrUnsupportedTarget

* feat: change error ErrInsufficientGas

* feat: Remove blank space among these if.
Add {} for in-new-line revert.

* feat: deleted unused file

* feat: update pre-commit  & storage layout log

* format: rename deprecated var

* Split Role enums & adaptation

* Apply suggestions from code review

* rename var

* feat: remove expectedCaller for ErrUnexpectedInternalCall

* Update contracts/libraries/Token.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/libraries/Token.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/mainchain/MainchainGatewayV2.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/mainchain/MainchainGatewayV2.sol

Co-authored-by: Bao <[email protected]>

* fix: fix validate logic bug

* format: rename notPoolAdmin modifier

* feat: update contract size log

* feat: enable storage slot migration

* feat: update contract size log

* feat: add delete operation to deprecated slot value

* fix: split to ErrTokenCouldNotTransfer error

* husky: add contract size log

* fix yarn.lock

---------

Co-authored-by: Bao <[email protected]>
Co-authored-by: Duc Tho Tran <[email protected]>
nxqbao added a commit that referenced this pull request Jun 27, 2023
* [*] Reduce code size: uncheck for loop iterations (#229)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

---------

Co-authored-by: Bao <[email protected]>

* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* chore: gitignore for yarn berry

* feat: bump [email protected]

* fix rebase issue

* Fix package issue. Upgrade node version for CI.

* add contract size log

* format: rename internal fn

* format: rename internal fn

* format: remove duplicated import

* format: reorder import

* chore: reduce unused log file

* format: rename internal fn

* Update contracts/extensions/GovernanceAdmin.sol

Co-authored-by: Duc Tho Tran <[email protected]>

* format: fix weird grouping

* fix: fix bug not return whole tx if using internal fn

* format: rename internal fn

* Update contracts/extensions/bridge-operator-governance/BOsGovernanceRelay.sol

Co-authored-by: Duc Tho Tran <[email protected]>

* format: rename internal fn

* format: fix weird grouping

* format: fix weird grouping

* Update contracts/extensions/forwarder/Forwarder.sol

Co-authored-by: Duc Tho Tran <[email protected]>

* feat: rename Errors.sol -> CommonErrors.sol

* format: import only used error from lib

* format: rename enum Roles -> Role

* fix: fix error rename

* format: fix weird import grouping

* fix: remove duplicated for loop increment

* feat: uncheck while loop iteration

* feat: update contract size log

* [*] Reduce code size: remove bytecodehash (#245)

* feat: set bytecodehash to none to avoid nondeterministic bytecode and reduce overall code size by 0.04kb

* Update hardhat.config.ts

Co-authored-by: Duc Tho Tran <[email protected]>

---------

Co-authored-by: Duc Tho Tran <[email protected]>

* format: format code

* [*] Reduce Contract Size: uncheck all incrementation (#246)

feat: uncheck increment

* [*] Reduce code size: efficient hashing to avoid memory expansion (#241)

* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* feat: efficient hashing

* [CI] Test for `reduce-contract-size` branch (#244)

add ci for reduce-contract-size

* feat: add contract size log

* feat: update contract size log

* format: rename parameter for new code convention

* format: format code

* fix: remove storage layout log

* fix: delete storage layout

* fix: delete yarn lock

* feat: remove changes in yarn.lock

* revert change in package.json & yarn.lock

---------

Co-authored-by: Bao <[email protected]>
Co-authored-by: Duc Tho Tran <[email protected]>

* [*] Reduce code size: Remove duplicated authorized contract getter/settter logics utilizing only 1 abstract class (#242)

* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* feat: merge collections contract to one contract

* feat: apply HasContract to other contracts

* chore: remove unused contracts

* [CI] Test for `reduce-contract-size` branch (#244)

add ci for reduce-contract-size

* feat: add contract size log

* chore: rename deprecated values

* chore: rename custom slot

* feat: change ErrZeroCodeContract parameter

* feat: update contract size log

* Update contracts/ronin/validator/CoinbaseExecution.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/interfaces/collections/IHasContract.sol

Co-authored-by: Bao <[email protected]>

* feat: reserve 0 index for enum Roles

* chore: rename EMERGENCY_PAUSER -> PAUSE_ENFORCER_CONTRACT

* feat: arrange role contract or eoa by parity order

* [*]: Reduce code size: Revert custom error (#232)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* fix: fix branching error

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* fix: rename roles

* fix: rename roles and comment index

---------

Co-authored-by: Bao <[email protected]>

* [*] Reduce codesize: Modifier code size reduce (#233)

* feat: reduce overall code size by unchecking iteration

* fix: skip unchecking for nondeterministic for loop

* Update hardhat.config.ts

Co-authored-by: Bao <[email protected]>

* chore: update yarn.lock

* chore: move log -> logs

* feat: optimizer run 10 for RoninValidatorSet

* feat: convert all require strings to revert custom errors

* feat: move reused modifier body to internal function

* fix: fix branching error

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* fix: remove redundant file

* format: rename ErEmptyArrayLength error

* format: rename ErrEmptyArrayLength error

* format: add comment for ErrorHandler lib

* feat: provide more info on revert ErrUnauthorized

* format: comment for error code

* fix: convert hardcoded sighash to function for better readability

* feat: inline revert

* feat: add more informative error

* feat: update custom errors

* feat: move reused modifier body to internal function

* Update contracts/libraries/Proposal.sol

Co-authored-by: Bao <[email protected]>

* tmp: tmp commit

* format: update format

* format: fix function name

* Delete .yarnrc.yml

* Delete .gitattributes

* Delete .editorconfig

* Delete yarn-1.22.19.cjs

* format: group import

---------

Co-authored-by: Bao <[email protected]>

* format: rename internal fn

* feat: update contract code sizes log

* feat: update contract size log

* format: format code

* feat: rename HasContract -> HasContracts

---------

Co-authored-by: Bao <[email protected]>

* feat: preserve storage slot layouts

* feat: update contract size log

* format: update comment

* format: rename deprecated variable

* add comment of original code for asm

* Update contracts/libraries/DeprecatedSlots.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/libraries/Role.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/libraries/Role.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/libraries/Token.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/ronin/gateway/RoninGatewayV2.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/ronin/gateway/RoninGatewayV2.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/ronin/slash-indicator/CreditScore.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/ronin/staking/CandidateStaking.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/ronin/Maintenance.sol

Co-authored-by: Bao <[email protected]>

* refactor: add cmt, rename var, update asm

* fix rebase issues

* remove dev tag

* add storage layout

* fix comment

* format: move Role, DeprecatedSlots, CommonErrors to utils

* feat: change error ErrUnsupportedTarget

* feat: change error ErrInsufficientGas

* feat: Remove blank space among these if.
Add {} for in-new-line revert.

* feat: deleted unused file

* feat: update pre-commit  & storage layout log

* format: rename deprecated var

* Split Role enums & adaptation

* Apply suggestions from code review

* rename var

* feat: remove expectedCaller for ErrUnexpectedInternalCall

* Update contracts/libraries/Token.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/libraries/Token.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/mainchain/MainchainGatewayV2.sol

Co-authored-by: Bao <[email protected]>

* Update contracts/mainchain/MainchainGatewayV2.sol

Co-authored-by: Bao <[email protected]>

* fix: fix validate logic bug

* format: rename notPoolAdmin modifier

* feat: update contract size log

* feat: enable storage slot migration

* feat: update contract size log

* feat: add delete operation to deprecated slot value

* fix: split to ErrTokenCouldNotTransfer error

* husky: add contract size log

* fix yarn.lock

---------

Co-authored-by: Bao <[email protected]>
Co-authored-by: Duc Tho Tran <[email protected]>
@nxqbao nxqbao deleted the ci/test-for-reduce-contract-size branch August 10, 2023 06:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant