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

v0.6.4 #297

Merged
merged 138 commits into from
Oct 21, 2023
Merged

v0.6.4 #297

merged 138 commits into from
Oct 21, 2023

Conversation

nxqbao
Copy link
Contributor

@nxqbao nxqbao commented Oct 21, 2023

No description provided.

huyhuynh3103 and others added 30 commits May 18, 2023 13:25
* feat: emit event for tracking who voted

* fix: emit voter address

* fix: remove  in emergency exit test
* chore: add PR template

* chore: note base of the PR
* 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]>
Revert "[*] Reduce code size: uncheck for loop iterations (#229)"

This reverts commit 681e763.
* feat: script generate storage layout

* fix: style mock table and reinstall @type/node

* chore: remove redundant whitespace and re-generate storage layout
* feat: script generate storage layout

* fix: style mock table and reinstall @type/node

* chore: remove redundant whitespace and re-generate storage layout

* chore: Add instruction for extracting storage layout
…emergency (#237)

* fix bridge reward calc

* fix getter

* fix test
add ci for reduce-contract-size
* feat: script generate storage layout

* fix: style mock table and reinstall @type/node

* chore: remove redundant whitespace and re-generate storage layout

* chore: Add instruction for extracting storage layout

* chore: generating storage layout at pre-commit stage

* git chore: merge dev

* chore: add generated layout file to staging area

* fix: remove suffix identifier of data type in extracted storage layout

* fix: remove all identifier numbers

* fix: Change destination folder of extracted storage layout
* feat: generate storage layout in both types: inline & table

* fix: refactor generate storage layout task
* feat: generate storage layout in both types: inline & table

* fix: refactor generate storage layout task

* fix: fix error append file storage_layout.log
…250)

feat: bump hardhat-contract-sizer version & generate log file
…delegatecall to abuse pcu contracts" (#252)

Revert "[SlashIndicator, RoninValidatorSet]: DelegateGuard: restrict delegatecall to abuse pcu contracts (#234)"

This reverts commit d553583.

Co-authored-by: Duc Tho Tran <[email protected]>
* [*] 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]>
* feat: init commit

* feat: update test

* feat: add more test

* feat: restrict gas to prevent revert exhaust consumption

* format: update comment

* feat: update gas snapshot

* feat: update condition met for RV upgrader

* feat: simplify logic

* feat: update RVUpgrader logic

* format: friendlier code logic

* feat: move markPeriodAsEnded to private, rename fn

* feat: simplify logic

* feat: update gas snapshot

* format: minor refactor

* feat: update RVTimedMigrator test

* feat: update gas snapshot

* format: update natspec documentation

* feat: update format comment

* Update foundry.toml

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

* Update foundry.toml

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

* Update contracts/utils/version-control/RoninValidatorSetTImedMigrator.sol

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

* Update foundry.toml

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

* Update contracts/utils/version-control/RoninValidatorSetTImedMigrator.sol

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

* Update test/foundry/utils/version-control/ConditionalVersionControl.t.sol

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

* format code

* Update contracts/ronin/validator/migrations/RoninvalidatorSetTimedMigrator.sol

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

* Update contracts/mocks/utils/version-control/MockLogicValidatorSet.sol

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

* format: rename, format code

* Update contracts/extensions/version-control/ConditionalImplementControl.sol

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

* Update contracts/extensions/version-control/ConditionalImplementControl.sol

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

* Update contracts/extensions/version-control/ConditionalImplementControl.sol

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

* Update contracts/extensions/version-control/ConditionalImplementControl.sol

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

* format: rename parameter

* Update contracts/mocks/utils/version-control/MockConditionalImplementControl.sol

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

* format: rename params

* feat: remove try catch

* feat: add logic for _getVersion

* format: comment for _isConditionMet

* Update test

* Fix rebase issue

* feat: update receive test

* feat: update comment for immutable variable

* format: rename functions + document

* format: format & rename functions

* format: rename functions + rename variables

* add submodule

* ci: fix foundry installation

* ci: fix foundry installation

* Fix tests

* format: rename file

* fix: fix test error

* Fix workflows

* Fix update test

* feat: override test

* Remove duplicated test

* format: move snapshot to logs

* fix testname

* feat: update gas snapshot

* rename

* rename

* update gas snapshot

---------

Co-authored-by: Duc Tho Tran <[email protected]>
Co-authored-by: Bao <[email protected]>
* Add CI for testnet branch (#251)

add ci for testnet

* add logic deployments

* feat: add initializable for PauseEnforcer

* fix: add initv2 for gateway

* add upgrade script, add deployments

* fix: pause enforcer test

* fix: fix param, restrict network for the script

* add GA upgrade script

* fix mainchain deploy script

* add comment

* add two failed upgrade scripts

* fix hardcoded explorer url

* rename script

* redeploy gatewayV2 and revote
* clmcc

* feat: remove bridge logic & comment test

* Update contracts/ronin/validator/RoninValidatorSet.sol

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

* featL remove bridge operator in applyValidatorCandidate

* format: named args

* feat: remove bridge reward deprecated at period

* feat: remove ValidatorFlag from getValidators()

* feat: remove isValidator & deprecate bridge enum

* fix: fix test

* Update contracts/ronin/staking/CandidateStaking.sol

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

* format: skip test

* format: add comments

---------

Co-authored-by: Bao <[email protected]>
Co-authored-by: Duc Tho Tran <[email protected]>
* hotfix: initialize in gateway

* add config and deployment

* update deployments

* update new deployment
* clmcc

* feat: remove bridge logic & comment test

* Update contracts/ronin/validator/RoninValidatorSet.sol

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

* featL remove bridge operator in applyValidatorCandidate

* format: named args

* feat: remove bridge reward deprecated at period

* feat: remove ValidatorFlag from getValidators()

* feat: remove isValidator & deprecate bridge enum

* fix: fix test

* Update contracts/ronin/staking/CandidateStaking.sol

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

* format: skip test

* format: add comments

* feat: update bridge admin contract

* feat: add more checks

* feat: allow secondary address to update bridge operators

* feat: auth accounts

* fix: downgrade openzeppelin packages

* feat: getBridgeOperatorOf

* feat: bridge proposal

* feat: bridge voter weight

* feat: update domain separator

* format: minor refactor

* fix: fix logic

* feat: add minor test cases

* feat: add more tests

* feat: update tests

* feat: main chain bridge admin

* format: delete unused import

* format: rename function

* feat: remove bridge logic

* format: rename variable

* format: format code

* feat: update main chain bridge admin logic

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

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

* format: fix convention

* format: refactor

* format: add doc for storage declarations

* feat: add ErrInvalidArguments

* format: rename test cases

* format: add variable visibility

* remove bridge in GA deploy

* rename contract

* add deploy script

* feat: update gas snapshot

* feat: update events

* add test setup

* fix: only Self Call instead of only Bridge contract

* feat: update events

* feat: add bridgeOperators when create contract

* rename to Bridge Manager

* fix: remove admin address

* fix: add propose function for bridge manager

* format: format code

* Update contracts/interfaces/IBridgeManager.sol

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

* feat: check non duplicate between governor and bridge operator

* feat: support global vote for ronin bridge

* fix: remove check empty

* fix: init test

* fix: redundant nonDuplicate

* feat: getProposalExpiryDuration

* feat: remove trusted orgs weight from ronin gateway

* chore: remove console log

* test: fix configuration test

* test: restructure test set-type helper

* fix: constructor param order

* test: fix gateway pause enforcer test

* feat: remove global proposal

* fix: fix propose in test

* fix: fix config test

* fix: trusted vote count in test

* fix: fix other tests of gateway

* test: skip bridge set in GA test

* feat: split global proposal logics

* test: fix high nonce

* fix: readd expiryDuration to RoninGA

* test: fix mainchain GA test, add TODO

* test: fix integration bridge tracking test

* feat: TUint256 for custom slot uint256

* feat: add BridgeReward contract

* feat: check operator address must be payable

* feat: add initV3 for bridgeTracking

* feat: add SlashBridgeIndicator

* format: add comments, minor refactor

* feat: move onlySelfCall logic to `IdentityGuard`

* fix: use `RONTransferHelper` for native transfer operation

* fix: handle scattering reward twice

* fix: deployment scripts

* fix: remove expiry mainchain, fix deploy script

* fix: remove mainchainGA deploy, add bridgeAdmin deploy

* format: rename bridge slash contract

* format: rename `BridgeOperatorStatus` to `BridgeSlashInfo`

* feat: disable initializer

* refactor: re-split global GA, fix fixture

* fix: bridge tracking test setup

* fix: move query operator's info to tracking contract

* fix: rename 'penalize' to 'penalty' to fix grammar

* feat: integrate reward to slash contract

* fix: fix slash logic

* feat: remove auto remove functionality

* fix: fix event logic

* fix: order of assign to avoid misuse

* fix: fixture for hardhat test

* format: update comment for `execSlashBridgeOperators`

* fix: fix slashing logic

* feat: add common error `ErrInvalidReturnData`

* fix: handle zero vote in bridge reward

* feat: minor refactor

* format: add doc for `BridgeManager`

* fix: fix test

* format: remove duplicate `ErrZeroCodeContract` definition

* fix: fix test

* fix: merge code issue, add topup amount to test, fix test

* chore: lint coding convention

* chore: remove console log

* fix: fix wrong side assignment

* feat: replace getRoles by array to by enum

* fix: shadow declaration

* fix: begin block.timestamp in test

* feat: update version domain separator

* feat: add BridgeSlash test

* format: convention

* feat: check payable address in `updateBridgeOperator`

* feat: add `NewBridgeOperatorsAdded` event, `getAddedPeriodOf`

* test: add `test_bridgeSlash_recordEvents_onBridgeOperatorsAdded`

* feat: add `callbackRegisters` to `BridgeManager` constructor

* feat: add `supportsInterface`

* format: rename `BridgeManagerCallback` to `BridgeManagerCallbackRegister`

* fix: modify assertion, update docs

* feat: add receiveRON

* feat: add `test_slashTierLogic`

* fix: fix bridge manager deployments

* feat: add signature's method for bridge gw, fix test

* format: remove magic numbers

* fix: fix method visibility

* fix: default expiry duration on mainchain

* refactor: bring getSig and voted method into abstract contract

* fix: fix BridgeAdmin test

* format: refactor `BridgeSlash`

* test: add more tests

* feat: add local network proposal for BridgeManager

* fix: remove requireHasCode in constructor

* fix: fix integration test setup

* feat: add fuzz test for reward splitting logic `BridgeReward`

* test: add `test_WhenTotalBallotsZero_NotValidBridgeTrackingResponse`

* format: move `_requireSupportsInterface` to `IdentityGuard`

* feat: update `test_ExcludeNewlyAddedOperators_ExecSlashBridgeOperators`

* fix: handle share reward equally

* feat: differentiate share equally vs invalid tracking

* format: rename `test_SlashTierLogic` to `test_Fuzz_SlashTierLogic`

* format: add comments for `BridgeSlashTest` and `BridgeRewardTest`

* format: minor refactor

* feat: update `gas-snapshot` and `code size` logs

* fix: missing initializer in BridgeReward

* fix: load single field in `_getWeight`

* fix: remove error handling when callback revert

* format: remove unused lib

* feat: minor `extend` gas optimization

* Update contracts/interfaces/bridge/IBridgeManager.sol

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

* format: remove `ChainTypeConsumer`, `AccessControlEnumerable`

* format: remove `Strings` lib

* Merge branch `dev` into feat/bridge-admin

* fix: fix bug `BridgeManager:updateBridgeOperator`

* fix: fix `BridgeManager:_addBridgeOperators` and `BridgeManager:_removeBridgeOperators`

* feat: minor gas optimization

* feat: only emit `Notified` if contains registers

* fix: fix `BridgeSlash:execSlashBridgeOperators` use `totalVotes` as denominator instead of `totalBallots`,
feat: handle callback `IBridgeManagerCallback:onBridgeOperatorUpdated` to update slash info to new bridge operator

* feat: remove `IdentityGuard:_requirePayableAddress`

* fix: auto and manually sync reward

* fix: comparison in sync reward

* feat: `BridgeManager:_addBridgeOperators`, `BridgeManager:_removeBridgeOperators` skip add/remove operations when inputs are empty.

* fix: handle call reward

* fix: fix deployment

* fix: only return true for status if both GVs and BOs are updated.
fix: not allow BOs { B } to add A, and GVs { A } to add B

* format: rename `BridgeVoter` to `Governor`
feat: add `BridgeManager:getFullBridgeOperatorInfos`
  function _getTotalWeight() internal view virtual override returns (uint256) {
fix: `RoninGatewayV2:_getVoteWeight`, `RoninGatewayV2:`
format: remove `LibTUint256.sol`

* feat: add `BridgeManagerCallbackRegister:getCallbackRegisters`

* feat: add `bytes callData` to `IBridgeManagerCallbackRegister:Notified` event

* format: rename `register` to `contractAddr`
format: remove return data in `LibUint256Slot:store`

* format: remove `BridgeManager:getGovernorWeight`

* feat: minor optimization `BridgeManager:updateBridgeOperator`

* fix: fix `RoninGatewayV2` test

* format: add comment for `IdentityGuard:_requireSupportsInterface`

* format: add comments and minor refactor

* feat: use`IdentityGuard:_requireCreatedEOA` instead of `IdentityGuard:_requireNonZeroAddress`

* refactor: minor optimization

* format: minor refactor

* format: rename `getSumGovernorWeights` to `sumGovernorsWeight`

* fix: fix `_addBridgeOperators` branching logic

* fix: fix test

* feat: format `voteWeights` to `uint96`

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

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

* Update contracts/utils/IdentityGuard.sol

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

* fix: fix duplicate address update in `BridgeManager:updateBridgeOperator`
format: remove stack too deep comment
format: remove unnecessary underscore prefix

* feat: move `onlyGovernor` to `BridgeManager`

* feat: add `memory-safe` assembly
format: minor refactor

* format: remove return value `updated` for `BridgeManager:updateBridgeOperator`
feat: add view methods `getBridgeOperatorWeights`, `getBridgeOperatorWeight`
feat: update `MainchainGatewayV2`
format: add comments for internal methods

* fix: reduce risk of reentrancy

* feat: minor refactor

* feat: add `MainchainGatewayV2:supportsInterface`

* format: minor refactor

* feat: remove unused functions

* format: rename `_unsafeSendRON` to `_unsafeSendRONLimitGas`

* format: deprecate storage var

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

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

* feat: minor refactor

* feat: move `event`, `struct`, `enum` to to other interface
format: rename variable
feat: allow sync reward for multiple periods
feat: add bridge tracking response validation for `BridgeSlash`
fix: remove `onlyContract` guard in `BridgeReward:_syncReward`
format: use named arguments
feat: custom slots for `BridgeReward`
format: add documentations

* format: add doc

* fix: remove `BridgeSlash:setContract`

* feat: only slash if `totalVotes` >= `MINIMUM_VOTE_THRESHOLD`

* fix: BridgeReward:LATEST_REWARDED_PERIOD_SLOT empty value when `syncReward`

* fix: fix mishandle `execSyncReward`
format: add comments
feat: add `getTotalRewardsToppedUp`, `getTotalRewardsScattered`
feat: prevent mis transfer RON to logic contract

* format: rename var

* feat: remove dead code

* format: minor refactor

* format: minor refactor

* feat: add `_requireNonZeroAddress` in `_requireCreatedEOA`

* fix: emit event

* chore: remove plural form of `total-` var

* fix: prevent reverting in `BridgeTracking:recordVote`

* chore: fix convention

* fix test

* fix: collided vars

* fix: revert when invalid`periodLength`

* feat: add `ErrSyncTooFarPeriod` if `period > latestRewardedPeriod + 1`

* fix: use `getBridgeOperatorOf` instead of `getBridgeOperators`

* feat: add fork test

* feat: allow `proxyAdmin` to query for `supportsInterface`

* chore: update comment, fix test method visibility

* ci: exclude fork test

* fix: exclude fork test

* fix: exclude fork test in ci

* fix: remove `_requireCreatedEOA`

---------

Co-authored-by: Bao <[email protected]>
Co-authored-by: Duc Tho Tran <[email protected]>
* deploy: fix config

* fix: test setup

* deploy: separate deploy fixture of dpos and gateway

* fix: add temp todo for contract hotfix

* deploy: fix fixture and test integration

* deploy: add deployment files

* feat: resolve target options internally in global proposal

* deploy: add new deployments

* chore: add docs

* feat: expose update TargetOptions

* fix: remove batch getter

* deploy: redeploy bridge proxy

* fix: not allow update current target

* deploy: redeploy contract

* deploy: mainchain fix delp script and add delp

* script: add s1 script

* chore: restructure script folder

* script: fix S1

* script: minor fix s1. add s2.

* deploy: add timed migrator deploy script and artifacts

* script: add s5 script

* chore: remove comments

* deploy: add mainchain deployment artifacts

* feat: add `NewBridgeForkTest:test_Fork_DepositToGateway`

* package: update hardhat to use companion network

* script: change s2 to roninchain's proposal

* script: add s3 and s4 script

* script: fix getter of companion network name

* fix: fix length mismatch bug

* fix: fix `ErrQueryForDupplicated` check

* script: add s1 second run script

* fix: edit config to new goerli bridge

* script: add rollback script

* format: remove unused import

* test: fix rep2 fork test

* package: add sourcify command

---------

Co-authored-by: TuDo1403 <[email protected]>
@nxqbao nxqbao merged commit eb38695 into mainnet Oct 21, 2023
1 check passed
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.

4 participants